package com.jeesite.modules.kj.api.vo.request;

import com.jeesite.common.shiro.realms.K;
import com.jeesite.modules.kj.entity.KjMember;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * Author:hzy
 * Date:2021/07/04
 * Description:注册所需参数
 */
@Data
public class RegisterRequestVo {
    @NotBlank(message = "会员名不能为空")
    @ApiModelProperty(value="会员姓名", example = "张三", required = true)
    String memberName;

    @NotBlank(message = "会员类型不能为空")
    @ApiModelProperty(value="会员类型", example = "1", required = true)
    String memberType;

    @NotBlank(message = "生日不能为空")
    @ApiModelProperty(value="生日", example = "1988-05-10", required = true)
    String birthday;

    @NotBlank(message = "手机号不能为空")
    @ApiModelProperty(value="手机号", example = "18999999999", required = true)
    String mobile;

    @ApiModelProperty(value="常驻地", example = "北京", required = true)
    String address;

    @ApiModelProperty(value="中兴员工号", example = "000011")
    String memberNo;

    @ApiModelProperty(value="政府志愿者号", example = "000011")
    String volunteerNo;

    @ApiModelProperty(value="头像地址", example = "http://img.xxxxx")
    String headimg;
    @ApiModelProperty(value="openid", example = "11111111")
    String openid;

    public KjMember convertToMember(){
        KjMember entity = new KjMember();
        entity.setAddress(address);
        entity.setBirthday(birthday);
        entity.setName(memberName);

        entity.setHeadimg(headimg);
        entity.setMemberType(memberType);
        entity.setMobile(mobile);
        entity.setMemberNo(memberNo);
        entity.setVolunteerNo(volunteerNo);
        entity.setWxopenid(openid);
        return entity;
    }
}
